#ifndef  __JX_H_
#define		__JX_H_


#ifdef	JX_GLOBAL
	#define	JX_EXT	
#else
	#define	JX_EXT	extern
#endif


#define JX_ENV_DZOOM_SW		    0
#define JX_ENV_DZOOM_MODE	    VISCA_DZOOM_CLOSE 

#define CAM_AE_WIN_OFF		    0x0000
#define CAM_AE_WIN_DEFAULT		0x0000
#define CAM_AF_WIN_DEFAULT		0x0000
#define AF_WIN_OFF              0x0000


#define JX_ENV_AGC				0x09
#define JX_ENV_EXPCOMP_SW	    0
#define JX_ENV_EXPCOMP_LEVEL	5
#define JX_ENV_HR_SW			0
#define JX_ENV_WD_SW		    0
#define JX_ENV_DEFINITION		0x5
#define JX_ENV_BLC_STA		    CAM_BLC_OFF
#define JX_ENV_LR_SW			0
#define JX_ENV_FLIP_SW		    0
#define JX_ENV_FREEZE_SW		0


#define JX_ENV_DZOOMMAG_LIMIT      HIK_DZOOM_LEVEL


#define VISCA_CMD_MAX_LEN  		    40
#define	VISCA_CMD_HEADER			0X80
#define	VISCA_CMD_END				0XFF

#define PELCOD_CMD_HEADER           0xFF
#define PELCOD_CMD_LEN              7                    
#define PELCOP_CMD_HEADER           0xa0
#define PELCOP_CMD_LEN              8



#define VISCA_DZOOM_OPEN			SW_B_TRUE
#define	VISCA_DZOOM_CLOSE			SW_B_FALSE
#define	VISCA_DZOOM_MODE_INVALID	-1
#define	VISCA_DZOOM_COMBINE		    1
#define	VISCA_DZOOM_SEPERATE		2

#define	TITLE_LEN_MAX	    		20
#define	TITLE_LINES_MAX				11
#define	TITLE_OSD_ASCLL				80

#define EXPCOM_MAX_LEVEL 10
#define SHARPNESS_MAX_LEVEL 10
#define SATURATION_MAX_LEVEL 10
#define BRIGHTNESS_MAX_LEVEL 10
#define CONTRAST_MAX_LEVEL 10
#define NR_MAX_LEVEL 10
#define IRIS_MAX_LEVEL 0x11
#define WD_MAX_LEVEL 10
#define PENETRATEFOG_MAX_LEVEL 10


#define OSD_POS_CMD   				0x10
#define OSD_PRE10CHAR_CMD 			0x20
#define OSD_NXT10CHAR_CMD 			0x30
#define OSD_CHAR_MAX_NUM   			20/*һ��������ʾ20��ascII�ַ���10�������ַ�*/
#define OSD_BLANKSPACE    			0x20/*�ո�*/

#define MAX_NETOSD_LINE             15           /* ���?4���ַ� */


typedef enum
{
	_BLANK = 0x20,
	_EXCLAM = 0x21,//!
	_Danyinhao,
	_Jinghao,
	_Dollar,//$
	_Baifenghao,
	_Yuhao = 0x26,//&
	_Yinhao,
	_Kaikuohao,
	_Bikuohao,
	_Xinghao,
	_Jiahao,
	_Douhao,
	_HENG = 0x2d,//'-'
	_DOT = 0x2e,//.
	_Xiegang,
	_0 = 0x30,	//0	
	_1 = 0x31,	//1	
	_COLON = 0x3a,	//:
	_Wenhao = 0x3f,//��
	_A = 0x41,	//A
	//�������Ĳ���
	
}OSDZiMoNVPPublic;





typedef enum
{
	VISCA_CMD				    = 0x01,  // �ڶ����ֽ�Ϊ1��ʾ��������
	VISCA_INQUERY			    = 0x09,  // �ڶ����ֽ�Ϊ9��ʾ��ѯ����

	VISCA_VISCA_CMD		        = 0x04, // �������ֽ�Ϊ4��ʾSONY VISCA��������
	VISCA_HIK_CMD			    = 0x09, // �������ֽ�Ϊ9��ʾHIK VISCA��������

	VISCA_VISCA_INQUERY 	    = 0x04, // �������ֽ�Ϊ4��ʾSONY VISCA��ѯ����
	VISCA_HIK_INQUERY 		    = 0x09, // �������ֽ�Ϊ9��ʾHIK VISCA��ѯ����

	VISCA_CMD_ZOOM		        = 0x07, //ZOOM TELE WIDE STOP
	VISCA_CMD_ZOOM_DIRECT       = 0x47, // ZOOM DIRECT
	VISCA_CMD_DZOOM			    = 0X06, //DZOOM SW ,TELE WIDE STOP
	VISCA_CMD_DZOOM_MODE		= 0X36, //DZOOM MODE
	VISCA_CMD_DZOOM_DIRECT	    = 0X46, //DZOOM DIRECT
	VISCA_CMD_FOCUS			    = 0X08, //FOCUS
	VISCA_CMD_FOCUS_DIRECT 	    = 0X48, // FOCUS DIRECT
	VISCA_CMD_FOCUS_MODE		= 0X38, // FOCUS MODE
	VISCA_CMD_FOCUS_SPECIAL	    = 0X18, //INTERVAL INFINITE
	VISCA_CMD_AF_SENSE			= 0X58, //AF SENSE
	VISCA_CMD_FOCUS_LIMIT		= 0X28, 
	VISCA_CMD_AF_MODE			= 0X57, // AF MODE
	VISCA_CMD_AF_TIME                   = 0X27,
	VISCA_CMD_IR_CORRECTION     = 0X11,//FOCUS IR compensation data switching
	VISCA_CMD_CAM_INIT			= 0X19, // CAM INIT
	VISCA_CMD_WB				= 0X35,  // WB MODE
	VISCA_CMD_WB_PUSH_TRIG	    = 0X10, 
	VISCA_CMD_R_GAIN			= 0X03, // R GAIN
	VISCA_CMD_B_GAIN			= 0X04, // B GAIN
	VISCA_CMD_R_DIRECT			= 0X43, // R DIRECT
	VISCA_CMD_B_DIRECT			= 0X44, // R DIRECT
	VISCA_CMD_AE_MODE			= 0X39, // AE MODE
	VISCA_CMD_SHUTTER			= 0X0A, // SHUTTER
	VISCA_CMD_SHUTTER_DIRECT	= 0X4A, // SHUTTER DIRECT
	VISCA_CMD_SLOW_SHUTTER	    = 0X5A, // SLOW SHUTTER
	VISCA_CMD_IRIS				= 0X0B, // IRIS
	VISCA_CMD_IRIS_DIRECT		= 0X4B, 
	VISCA_CMD_AGC				= 0X0C, 
	VISCA_CMD_AGC_DIRECT		= 0X4C, 
	VISCA_CMD_GAIN_LIMIT        = 0X2C,
	VISCA_CMD_BRIGHT            = 0X0D,
	VISCA_CMD_BRIGHT_DIRECT     = 0X4D,
	VISCA_CMD_EXPCOMP_SW		= 0X3E, 
	VISCA_CMD_EXPCOMP			= 0X0E, 
	VISCA_CMD_EXPCOMP_DIRECT	= 0X4E, 
	VISCA_CMD_BLC				= 0X33,
	VISCA_CMD_SPOTAE_SW         = 0X59,
	VISCA_CMD_SPOTAE_POS        = 0X29,
	VISCA_CMD_AE_RESPONSE       = 0x5D,
	VISCA_CMD_WD				= 0X3D, 
	VISCA_CMD_WD_PARA           = 0X2D,
	VISCA_CMD_WD_REPLY          = 0X3B, 
	VISCA_CMD_DEFINITION		= 0X02, 
	VISCA_CMD_DEF_DIRECT		= 0X42, 
	VISCA_CMD_HR                = 0X52,
	VISCA_CMD_NR				= 0X53, 
	VISCA_CMD_GAMMA             = 0X5B,
	VISCA_CMD_HIGHSENSITIVITY   = 0X5E,
	VISCA_CMD_MIRROR			= 0X61, 
	VISCA_CMD_FREEZE			= 0X62,	
	VISCA_CMD_PICT_EFFECT		= 0X63, 
	VISCA_CMD_PICT_FLIP		    = 0X66, 
	VISCA_CMD_ICR				= 0X01, 
	VISCA_CMD_DEFOG				= 0X37, 
	VISCA_CMD_AUTO_ICR		    = 0X51, 
	VISCA_CMD_AUTO_ICR_SENSE	= 0X21, //������о�Լ����ӵ�����	
	VISCA_CMD_IMAGE_STABLE	    = 0X34, 	//�����о��û���������
	VISCA_CMD_ICR_ALARMREPLAY   = 0X31,
	VISCA_CMD_MEMORY            = 0X3F,
	VISCA_CMD_MEM_SAVE          = 0X23,
	VISCA_CMD_DISPLAY           = 0X15,
	VISCA_CMD_TITLE			    = 0X73, 
	VISCA_CMD_TITLE_DISPLAY	    = 0X74,
	VISCA_CMD_MUTE              = 0X75,
	VISCA_CMD_SET_MASK		    = 0X76, 
	VISCA_CMD_MASK_DISP		    = 0X77, 
	VISCA_CMD_MASK_COLOR		= 0X78, 
	VISCA_CMD_PANTILT_ANGLE	    = 0X79,
	VISCA_CMD_PTZ_MASK		    = 0X7B, 
	VISCA_CMD_NON_INTERLOCK_MASK = 0X6F, 
	VISCA_CMD_MASK_GRID		    = 0X7C, 	
	VISCA_CMD_ID_WRITE          = 0X22,
	VISCA_CMD_ALARM_SWITCH      = 0X6B,
	VISCA_CMD_ALARM_MODE          = 0X6C,
	VISCA_CMD_ALARM_DAYNIGHTLEVEL = 0X6D,
	VISCA_CMD_MD_MOD              = 0X1B,
	VISCA_CMD_MD_FUNCTION         = 0X1C,
	VISCA_CMD_MD_WINDOW           = 0X1D,
	VISCA_CMD_CON_ZPOSREPLAY      = 0X69,
	VISCA_CMD_REPLAYTIME_SET      = 0X6A,
	VISCA_CMD_RESOLUTION	      = 0X24,
	VISCA_CMD_COLOR_ENCHANCE      = 0X20,
	VISCA_CMD_CHROMA_SUPRESS      = 0X5F,

	HIK_CMD_AE_WIN   		    = 0x55,	//���ø���ȤAE����
	HIK_CMD_AF_WIN              = 0X5A, //���ø���ȤAF����
	HIK_CMD_AF_WIN_DEFULAT 	    = 0x5B,
	HIK_CMD_AE_WIN_DEFULAT 	    = 0x5C,
	HIK_CMD_MODE                = 0x2E,
	HIK_CMD_CHROMA			    = 0X16, 
	HIK_CMD_CONTRAST			= 0X2D, 
	HIK_CMD_CONTRAST_DIRECT		= 0X8D,
	HIK_CMD_SATURATION			= 0X2B, 
	HIK_CMD_SATURATION_DIRECT	= 0X8B,
	HIK_CMD_BRIGHTNESS			= 0X2C, 
	HIK_CMD_BRIGHTNESS_DIRECT	= 0X8C,
	HIK_CMD_MENU_SW			    = 0X05, 
	HIK_CMD_OSD_DISP			= 0X06, 
	HIK_CMD_HLC_LEVEL			= 0x17,
	HIK_SLOW_SHUTTER_LIMIT	    = 0X2A,
	HIK_CMD_DPC                 = 0x2F,//�����޸��ӿ�
	HIK_CMD_DEFAULTPRESET       = 0x94,
	HIK_CMD_SETPRESET           = 0x95,
	HIK_CMD_DELPRESET           = 0x97,
	HIK_CMD_GOPRESET            = 0x96,
	HIK_CMD_ISP_WRITE_FPGA		= 0x30,
	HIK_CMD_PARA_SAVE_AND_REG	= 0X24,
	HIK_CMD_AUTO_GBCE_Level     = 0X26,
	HIK_CMD_SMART_IR            = 0x28,
	HIK_CMD_BLC_AREA			= 0x62,
	HIK_CMD_PANTILT_ANGLE	    = 0X79,

	HIK_CMD_IMAGE_SNAP	    	= 0X80,
	HIK_CMD_VIDEO_SWITCH	    = 0X81,
	HIK_CMD_TRANS_DATA	   		= 0X82,
	HIK_CMD_CUSTOM_CFG	   		= 0X83,	//��չ��������


	HIK_CMD_PTZ = 0xC0,
	HIK_CMD_AUTOPAN = 0xC1,
	HIK_CMD_LIGHT =  0xC2,
	HIK_CMD_WIPER = 0xC4,
	HIK_CMD_PATTERN = 0xC5,
	HIK_CMD_NIGHT_MODE = 0xC7,
	HIK_CMD_MOTOR_CONTROL_OUT = 0x50,
	HIK_CMD_ALARM = 0x51,
	HIK_CMD_PRESET_STATUS = 0x52,
	HIK_CMD_ZOOMLIMIT = 0x12,

	HIK_CMD_PAL_SET = 0xC6,
    HIK_CMD_TOUWU = 0X31,
    
	VISCA_VISCA_INQ_VERSION	= 0X00, 
	VISCA_HIK_INQ_ID			= 0x48, 

	VISCA_VISCA_INQ			= 0X04, 
	VISCA_HIK_INQ				= 0X09, 

	VISCA_INQ_ICR				= 0X01, 
	VISCA_INQ_ZOOM				= 0X47, 
	VISCA_INQ_FOCUS			= 0X48, 	
	VISCA_INQ_AF_MODE			= 0X57, 	
	VISCA_INQ_DZOOM_SW		= 0X06, 
	VISCA_INQ_DZOOM_MOD		= 0X36, 
	VISCA_INQ_DZOOM_POS		= 0X46, 
	VISCA_INQ_FOCUS_MOD		= 0X38, 
	VISCA_INQ_TEMP				= 0X68, 
	VISCA_INQ_SYS				= 0X7E, 

	HIK_INQ_VERSION			= 0X00, 
	HIK_INQ_MENU_STA			= 0X02, 
	HIK_INQ_IF_WD				= 0X04, 
	HIK_INQ_GAIN_Value = 0x05,//added by yejun
	HIK_INQ_AUTO_GBCE_Level      = 0x26,
	HIK_INQ_FPGA_VERSION       = 0X37,
	HIK_INQ_SHUT_lEVEL			=0x2A,
	HIK_INQ_SLOWSHUT_LEVEL		=0x5C,
	HIK_INQ_SYS_STA                        =0xE0,
	HIK_INQ_SMART_IR                     = 0x28,
	HIK_INQ_LENS_TYPE                    = 0xE1,
	HIK_INQ_AE_KEY_AREA 			= 0x55,
	HIK_INQ_AF_KEY_AREA 			= 0x5A,
	HIK_INQ_DEFOG_LEFEL 			= 0x31,
	HIK_INQ_ZOOM 			= 0xAD,
	HIK_INQ_CUSTOM_CFG	   		= 0X83,	//��չ���ܲ�ѯ
	HIK_INQ_BRIGHTNESS 			= 0x8C,
	HIK_INQ_STRONG_INHIBITION 	= 0x17,
	HIK_INQ_ZOOM_DISP 			= 0x06,
	HIK_INQ_DAYNIGHT_MODE 		= 0xC7,
	
	VISCA_INQ_FOCUS_NEARLIMIT  = 0X28,
	VISCA_INQ_AF_SENSITIVITY   = 0X58,
	VISCA_INQ_AF_TIMESET  = 0X27,
	VISCA_INQ_WB_MOD = 0X35,
	VISCA_ING_DEFOG	= 0X37, 
	VISCA_INQ_RGAIN = 0X43,
	VISCA_INQ_BGAIN = 0X44,
	VISCA_INQ_AE_MOD = 0X39,
	VISCA_INQ_SLOWSHUTTER_MOD = 0X5A,
	VISCA_INQ_SHUTTER_POS = 0X4A,
	VISCA_INQ_IRIS_POS = 0X4B,
	VISCA_INQ_GAIN_POS = 0X4C,
	VISCA_INQ_GAIN_LIMIT = 0x2C,
	VISCA_INQ_BRIGHT_POS = 0X4D,
	VISCA_INQ_EXPCOMP_MOD = 0X3E,
	VISCA_INQ_EXPCOMP_POS = 0X4E,
	VISCA_INQ_BACKLIGHT_MOD = 0X33,
	VISCA_INQ_RESPONSE = 0X5D,
	VISCA_INQ_SPOTAE_MOD = 0X59,
	VISCA_INQ_SPOTAE_POS = 0X29,
	VISCA_INQ_WD_MOD = 0X3D,
	VISCA_INQ_APERTURE = 0X42,
	VISCA_INQ_HR_MOD = 0X52,
	VISCA_INQ_LRREVERSE_MOD = 0X61,
	VISCA_INQ_FREEZE_MOD = 0X62,
	VISCA_INQ_PICEFFERCT_MOD = 0X63,
	VISCA_INQ_PICFLIP_MOD = 0X66,
	VISCA_INQ_AUTOICR_MOD = 0X51,
	VISCA_INQ_AUTOICR_THRESHOLD = 0X21,
	VISCA_INQ_MEMORY = 0X3F,
	VISCA_INQ_MEMSAVE = 0X23,
	VISCA_INQ_DISPLAY_MOD = 0X15,
	VISCA_INQ_TITLEDISPLAY_MOD = 0X74,
	VISCA_INQ_MUTE_MOD = 0X75,
	VISCA_INQ_PRI_DISPLAY = 0X77,
	VISCA_INQ_PRIPAN_TILT = 0X79,
	VISCA_INQ_PRIVACY_PTZ = 0X7B,
	VISCA_INQ_PRI_MONITOR = 0X6F,
	VISCA_INQ_KEY_LOCK = 0X17,
	VISCA_INQ_ID = 0X22,
	VISCA_INQ_EXTLOCK_MOD = 0X55,
	VISCA_INQ_VPHASE_SET = 0X25,
	VISCA_INQ_VPHASE_POS = 0X45,
	VISCA_INQ_VERSION = 0X02,
	VISCA_INQ_MD_MOD = 0X1B,
	VISCA_INQ_MD_FUNCTION = 0X1C,
	VISCA_INQ_MD_WINDOW = 0X1D,
	VISCA_INQ_CONTINUOUS_ZOOM = 0X69,
	VISCA_INQ_REPLYINTVAL_TIME = 0X6A,
	VISCA_INQ_REGISTER_VALUE = 0X24,
	VISCA_INQ_NR_LEVEL = 0X53,
	VISCA_INQ_GAMMA_LEVEL = 0X5B,			
	IRIS_VERSION		  = 0x99,	
	VISCA_INQ_MASK_GRID	  = 0X7C, 
	
}ViscaProtocolDef;


#define	ZOOM_DIRECT_IDX	    0
#define	FOCUS_DIRECT_IDX	1
#define	DZOOM_DIRECT_IDX	2

typedef struct
{
	SW_UINT8 JXaddress;
	SW_UINT8 Socket1;
	SW_UINT8 Socket2;
}ViscaAddrSockDef; // ��־����ִ�������ִ�������ռ�õ�socke

typedef struct
{
	SW_UINT8 Running;
	SW_UINT8 Socket;
}ViscaSlowCmdDef; // ��־����ִ�������ִ�������ռ�õ�socke




extern SW_INT16 RaptorDZoom[HISI_DZOOM_LEVEL];
JX_EXT SW_UINT8 ViscaProcACK[16];
JX_EXT SW_UINT8 ViscaProcCmdBuf[VISCA_CMD_MAX_LEN];

JX_EXT ViscaAddrSockDef ViscaAddrSocket;
JX_EXT ViscaSlowCmdDef ViscaSlowCmdStatus[3]; // һ����3������������ZOOM DIRECT; FOCUS DIRECT;������������  SLOW_VISCA_CMD_EXECUTE_PRIO1��Ϊ�Ƚ����Ŀ��Է������������?


JX_EXT  SW_INT	FocusDstCoord; 
JX_EXT  SW_INT	ZoomDstCoord;
JX_EXT  SW_INT	rs232WorkMode;
JX_EXT  SW_INT	ZoomFocusDirectWorkMode;

extern  SW_BOOL IsZoomDirectCtrlBy232;
extern  SW_BOOL IsFocusDirectCtrlBy232;
extern  SW_BOOL IsDomeConnect;


SW_UINT16 ProtocolLen(SW_UINT8 *pCmd);
void InitMultOSDTitle(void);
void IPZ_ZBC_VISCA_Init(void);
SW_UINT8 ViscaGetSocketNO(void);
SW_BOOL ViscaReleaseSocketNO(SW_UINT8 socket);
SW_BOOL ViscaAddressSet(SW_UINT8 *pCmd);
void ViscaIFClear(void);
void ViscaCmdSyntaxErr(void);
void ViscaCmdLenErr(SW_UINT8 socket);
void ViscaCmdBufFull(void);
void ViscaCmdNoExecute(SW_UINT8 socket);
void ViscaCmdACK(SW_UINT8 socket);
void ViscaCmdACKComplete(SW_UINT8 socket);
void UpdateFirmware(SW_UINT8 baud);
void ViscaCommandProc(SW_UINT8 *pCmd);
void ViscaCmdTrans(SW_UINT8 *pCmd);
void ViscaZoomTrans(SW_UINT8 *pCmd);
void ViscaFocusTrans(SW_UINT8	*pCmd);
void ViscaFocusModeTrans(SW_UINT8 *pCmd);
void ViscaFocusSenseTrans(SW_UINT8 *pCmd);
void ViscaFocusModeSpecialTrans(SW_UINT8 *pCmd);
void ViscaAFLimitTrans(SW_UINT8 *pCmd);
void ViscaAFSensitivityTrans(SW_UINT8 *pCmd);
void CamLensInitial(void);
void ViscaCamCorrectionTrans(SW_UINT8 * pCmd);
void ViscaAFModeTrans(SW_UINT8 *pCmd);
void ViscaZoomFocusTrans(SW_UINT8 *pCmd);
void ViscaWBModeTrans(SW_UINT8 *pCmd);
void ViscaWBPushTrigger(SW_UINT8 *pCmd);
void ViscaWBRedSetTrans(SW_UINT8 *pCmd);
void ViscaWBRedDirectTrans(SW_UINT8 *pCmd);
void ViscaWBBlueSetTrans(SW_UINT8 *pCmd);
void ViscaWBBlueDirectTrans(SW_UINT8 *pCmd);
void ViscaShutterSetTrans(SW_UINT8 *pCmd);
void ViscaShutterDirectSetTrans(SW_UINT8 *pCmd);
void ViscaApertureSetTrans(SW_UINT8 * pCmd);
void ViscaApertureDirectTrans(SW_UINT8 *pCmd);
void ViscaPictEffectTrans(SW_UINT8 *pCmd);
void ViscaICRSetTrans(SW_UINT8 *pCmd);
void ViscaAutoICRSWTrans(SW_UINT8 *pCmd);
void ViscaICRSensitivitySet(SW_UINT8 *pCmd);
void ViscaParaSaveUartSetTrans(SW_UINT8 *pCmd);
void ViscaWDTrans(SW_UINT8 *pCmd);
void ViscaContrastTrans(SW_UINT8 *pCmd);
void ViscaSaturationTrans(SW_UINT8 *pCmd);
void ViscaNoiseReduceSet(SW_UINT8 *pCmd);
void ViscaIrisSetTrans(SW_UINT8 *pCmd);
void ViscaIrisDirectTrans(SW_UINT8 *pCmd);
void ViscaAGCSetTrans(SW_UINT8 *pCmd);
void ViscaAGCDirectTrans(SW_UINT8 *pCmd);
void ViscaOsdDisplayTrans(SW_UINT8 *pCmd);
void ViscaICRModeInqTrans(void);
void ViscaZoomPosInqTransExt(void);
void ViscaZoomPosInqTrans(void);
void ViscaFocusPosInqTrans(void);
void ViscaFocusModeInqTrans(void);
void ViscaAFModInqTrans(void);
void ViscaViscaInqTrans(SW_UINT8 *pCmd);
void ViscaQueryIDTrans(SW_UINT8 *pCmd);
void ViscaInquiryProc(SW_UINT8 *pCmd);
void IrisDebug(SW_UINT8 *pCmd);
SW_BOOL IPZ_ZBC_LENS_IsDZoomValid(void);
SW_BOOL IPZ_ZBC_LENS_IsDZoomLock(SW_INT ul);
void ViscaSoftVersionInqTrans(void);
SW_UINT8 IPZ_ZBC_DEV_GetDZoomMode(void);
SW_FLOAT IPZ_ZBC_LENS_SonyRate2DZOOMPrecise(SW_INT sony_rate);
SW_INT GetIRISPwmLevel( SW_INT	idx);
SW_UINT	GetAgcGainLevel(SW_INT sta);
void ViscaFocusDirectSet(SW_UINT8	*pCmd);
SW_INT RetJX232Baud(SW_INT idx);
void ViscaAEModeTrans(SW_UINT8 * pCmd);
void ViscaExpCompLevelSetTrans(SW_UINT8* pCmd);
void ViscaExpCompLevelDirectSetTrans(SW_UINT8* pCmd);
void ViscaBlcSetTrans(SW_UINT8* pCmd);
void ViscaExpCompStatusSetTrans(SW_UINT8 * pCmd);
void ViscaLensSystemInq(SW_UINT8 *pCmd);
void ViscaCameraInfoSystemInq(SW_UINT8 *pCmd);
void ViscaFunctionsSystemInq(SW_UINT8 *pCmd);
void ViscaEnlargementSystemInq(SW_UINT8 *pCmd);
void ViscaDzoomSwInqTrans(void);
void ViscaDZoomModeInqTrans(void);
void ViscaDZoomPosInqTrans(void);
void ViscaAFSensitivityInqTrans(void);
void ViscaWbModInqTrans(void);
void ViscaRgainInqTrans(void);
void ViscaBgainInqTrans(void);
void ViscaAeModInqTrans(void);
void ViscaExpcompModInqTrans(void);
void ViscaExpcompPosInqTrans(void);
void ViscaFocusNearLimitInqTrans(void);
void ViscaShutterPosInqTrans(void);
void ViscaIrisPosInqTrans(void);
void ViscaGainPosInqTrans(void);
void ViscaApertureInqTrans(void);
void ViscaBacklightModInqTrans(void);
void ViscaInqStrongInhibitionTrans(SW_UINT8 *pCmd);
void ViscaPictureEffectModInqTrans(void);
void ViscaAutoICRModInqTrans(void);
void ViscaAutoICRThresholdInqTrans(void);
void ViscaPictureLRReverseTrans(void);
void ViscaPictureFlipTrans(void);
void ViscaAgcLevelLimit(SW_UINT8 *pCmd);
void ViscaGainLimitInqTrans(void);
void ViscaKeyAreaInqTrans(void);
void ViscaGAMMALevelInqTrans(void);
void UpdateFPGAFirmware(SW_UINT8 baud);
void ViscaGetGainValueInqTrans(void);
void ViscaChangeResolutionTrans(SW_UINT8 *pCmd);
void ViscaImageStableTrans(SW_UINT8 *pCmd);
void ViscaResolutionTransModInqExtTrans(void);
void ViscaAutoResolutionTransModInqTrans(void);
void DevDriverColorArray_MN34041(void);
void ViscaColourInhibitStrengthTrans(SW_UINT8 *pCmd);
void ViscaIDInqTrans(void);
void ViscaDNRTrans(SW_UINT8 *pCmd);
void ViscaGetGbceValueInqTrans(void);
void UpdateDpcCheck(SW_UINT8 flag);
void ViscaGbceLevelSetTrans(SW_UINT8 *pCmd);
void ViscaGetFPGAVersionInqTrans(void);
void AFModeSet(SW_UINT8 cmd);
void FocusModeSet(SW_UINT8 cmd);
void ViscaCrossCursorTrans(SW_UINT8 *pCmd);
void ViscaTitleTrans(SW_UINT8 *pCmd);
void ViscaTitleDisplayTrans(SW_UINT8 *pCmd);
void ViscaSlowShutDirTrans(SW_UINT8 *pCmd);
void ViscaSlowShutSwTrans(SW_UINT8 *pCmd);
void ViscaHlcTrans(SW_UINT8 *pCmd);
void ViscaHlcSwInqTrans(void);
void ViscaSlowShutLevelInqTrans(void);
void ViscaSlowShutSwInqTrans(void);
void ViscaShutLevelInqTrans(void);
void ViscaLRMirrorTrans(SW_UINT8 *pCmd);
void ViscaPictFlipTrans(SW_UINT8 *pCmd);
void ViscaMotorCotrolTrans(SW_UINT8 *pCmd);
void ViscaSmartIRTrans(SW_UINT8 *pCmd);
void ViscaDigitalZoomTrans(SW_UINT8 *pCmd);
void ViscaDigitalZoomDirectTrans(SW_UINT8 *pCmd);
void HikPresetTrans(SW_UINT8* pCmd);
void HikZoomPosInqTrans(void);
SW_INT UartChangeBaud(SW_INT  nb);
void ViscaSysStatusInqTrans(void);
void ViscaSmartIRInqTrans(void);
void ViscaZoomLimitTrans(SW_UINT8 *pCmd);
void ViscaPalNtscTrans(SW_UINT8 *pCmd);
void ViscaSetBlcAreaTrans(SW_UINT8* pCmd);
void ViscaAutoContrastSwTrans(SW_UINT8 *pCmd);
void ViscaLensTypeInqTrans(void);
void ViscaKeySetTrans(SW_UINT8* pCmd);
void ViscaAfAareaSetTrans(SW_UINT8* pCmd);
void ViscaDefulatAfAareaSetTrans(void);
void ViscaDefulatAeAareaSetTrans(void);
void ViscaTouwuTrans(SW_UINT8 *pCmd);
void ViscaVersionInqTrans(SW_UINT8 *pCmd);
void ViscaMaskGridInq(SW_UINT8 *pCmd);
int ViscaQueryTempTrans(void);
int ViscaAutoMaticTrack(int enable, unsigned int topx, unsigned int topy, unsigned int bottomx, unsigned int bottomy);
int ViscaAutoTrackCtrl(int panDir, int tiltDir, int panSpeed, int tiltSpeed);

//����Э��rs232͸��ͨ�����ݴ����·�
int ViscaRS232serialPortDataSend(unsigned char * buf, int length);



#endif

